<?php
require_once "./db_config.php";
if(isset($_POST['name'])){
    $name=$_POST['name'];
    $layout=$_POST['layout'];
    $sql="UPDATE dynamic_form SET layoutJSON='$layout' WHERE name='$name'";
    $result=mysqli_query($conn,$sql);
    if(! $result )
    {
        die('error: ' . mysqli_error($conn));
    }else{
        echo 'success';
    }
}
mysqli_close($conn);
